package org.dochandler.service.domain;

import java.io.Serializable;

import org.dochandler.service.exception.DocHandlerException;

public enum Rank implements Serializable {
	SOLDIER,
	CORPORAL,
	SARGENT,
	LIEUTENANT,
	CAPTAIN,
	MAJOR,
	COLONEL,
	BRIGADIER,
	GENERAL,
	MARSHAL;
	
	
	static public Rank fromValue(String value) {
		if (value != null) {
			for (Rank rank : values()) {
				if (rank.name().equals(value)) {
					return rank;
				}
			}
		}
		throw new DocHandlerException("Impossible to create enum from value: " + value);
	}
}
